class BiTree:
    def __init__(self, parent = None, value = None, lchild = None, rchild = None):
        self.parent = parent
        self.value = value
        self.lchild = lchild
        self.rchild = rchild

    def getparent(self):
        """
        :return: the parent of the Node
        """
        return self._parent

    def getvalue(self):
        """
        :return: the value of the Node
        """
        return self.value

    def getleft(self):
        """
        :return: the left child of the Node
        """
        return self.lchild

    def getright(self):
        """
        :return: the right child of the Node
        """
        return self.rchild

    def setvalue(self, newvalue):
        """
        :param newvalue: the new value of this Node
        :return: the the value of the Node
        """
        self.value = newvalue
        return self.value

    def setleft(self, newleft):
        """
        :param newleft: the new left child of this Node
        :return: the new left child of this Node
        """
        self.lchild = newleft
        return self.lchild

    def setright(self, newright):
        """
        :param newright: the new right child of this node
        :return: the new right child of this node
        """
        self.rchild = newright
        return self.rchild

    def setparent(self, newparent):
        """
        :param newparent: the new parent of this node
        :return: the new parent of this node
        """
        self.parent = newparent
        return self.parent
